#include"stack.h"

int main(int argc, char const *argv[])
{
    int num;
    scanf("%d", &num);
    seqstack *sq = init_stack(10);

    while(num > 0){
        switch (num % 16)
        {
        case 0 ... 9:
            push(sq, num%16+'0');
            break;
        case 10 ... 15:
            push(sq, num%16-10+'A');
            break;
        }
        num /= 16;
    }

    printf("0x");
    while(!isempty(sq)){
        char ch;
        pop(sq, &ch);
        printf("%c", ch);
    }
    printf("\n");
    return 0;
}
